package org.xlab.baseframework.test.base;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.transaction.TransactionConfiguration;
import org.springframework.transaction.annotation.Transactional;
import org.xlab.baseframework.service.api.ISystemLogService;


/**
 * 所有测试类的父类,结合了Spring与Junit测试框架,单元测试模板
 * 
 * @author MaKuBEX Email:makubexnet@gmail.com
 * @version 1.0.0 Sep 7, 2010
 * @since 1.0.0
 * 
 */
@RunWith(BaseTester.class)
@ContextConfiguration("classpath:/test/applicationContext-*.xml")
@TransactionConfiguration(transactionManager = "transactionManager", defaultRollback = true)
@Transactional
public class BaseTestTemplete {

	@AfterClass
	public static void afterClass() {
		System.out.println("@AfterClass");
	}

	@BeforeClass
	public static void beforeClass() {
		System.out.println("@BeforeClass");
	}

	@SuppressWarnings("unused")
	@Autowired
	@Qualifier("systemLogService")
	private ISystemLogService systemLogService;;

	/**
	 * 默认构造函数
	 */
	public BaseTestTemplete() {
		super();
	}

	@After
	public void after() {
		System.out.println("@After");
	}

	@Before
	public void before() {
		System.out.println("@Before");
	} // e.g

	// @Test(timeout = milliseconds, expected= Exception class)
	@Test
	public void testGetTradableCcy() {
		System.out.println("OK");
	}

	@Ignore
	@Test
	public void testIgnore() {
		System.out.println("@Ignore");
	}
}
